<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <title>选择服务商 - 租房宝金融管理平台</title>
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">
        <%@ include file="/WEB-INF/include/aside.jsp"%>

        <div class="content">
            <header class="header clearfix">
                <h3 class="pull-left">选择服务商</h3>
            </header>
            <c:if test="${not empty infoMessage}">
                <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
                  <button type="button" class="close" data-dismiss="alert">&times;</button>
                  <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
                  <fmt:message key="${infoMessage}" />
                </div>
            </c:if>
            <div class="table-area">
            	<form action="${ctx}/setting/save-app" method="post">
                <table class="data-list">
				            <thead>
				              <tr>
				                <th>序号</th>
				                <th>服务商名称</th>
				                <th>appId</th>
				                <th>操作</th>
				              </tr>
				            </thead>
				            <tbody>
				              <c:forEach var="app" items="${appList}" varStatus="status">
				                <tr>
				                  <td>${status.index + 1}</td>
				                  <td>${app.name}</td>
				                  <td>${app.appId}</td>
				                  <td>
				                  	<input type="radio" name="appId" value="${app.appId }"/>
				                  </td>
				                </tr>
				              </c:forEach>
				            </tbody>
                </table>
                <input type="hidden" value="${targetUrl }" name="targetUrl"/>
                </form>

            </div>

            <%@ include file="/WEB-INF/include/footer.jsp"%>

        </div>
    </div>


  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  <script>
  	$("input[type='radio']").click(function(){
  		
  		$("form").submit();
  	});
  	
  </script>
  
</body>
</html>
